<template>
  <div class="parent-page">
    <div v-if="toy">子组件的玩具：{{ toy }}</div>
    <br />
    <Child @send-data="SendData" />
  </div>
</template>
<script setup lang="ts" name="customEventParent">
import { ref } from 'vue';
import Child from './child.vue';
const toy = ref('');


function SendData(value:string){
  toy.value = value;
}

</script>
<style  scoped>
.parent-page{
  padding: 30px;
}
</style>
